export interface GetHospitalListParams {
  page: number;
  limit: number;
  status?: number;
  hoscode?: string;
  hosname?: string;
  hostype?: string;
  provinceCode?: string;
  cityCode?: string;
  districtCode?: string;
}

export type SearchOptions = Omit<GetHospitalListParams, "page" | "limit">;

export interface GetHospitalListResponse {
  content: HospitalList;
  totalElements: number;
}

export interface HospitalItem {
  id: string;
  createTime: string;
  updateTime: string;
  // isDeleted: number;
  param: {
    hostypeString: string;
    fullAddress: string;
  };
  hoscode: string;
  hosname: string;
  hostype: string;
  provinceCode: string;
  cityCode: string;
  districtCode: string;
  address: string;
  logoData: string;
  intro: null;
  route: string;
  status: number;
  bookingRule: BookingRule | null;
}

export interface BookingRule {
  cycle: number;
  releaseTime: string;
  stopTime: string;
  quitDay: number;
  quitTime: string;
  rule: string[];
}

export type HospitalList = HospitalItem[];

export interface GetHospitalDetailResponse {
  bookingRule: BookingRule;
  hospital: HospitalItem;
}

/*
  科室列表数据：
    [{
      "depcode": "a4e171f4cf9b6816acdfb9ae62c414d7",
      "depname": "专科",
      "children": [
        {
          "depcode": "200040878",
          "depname": "多发性硬化专科门诊",
          "children": null
        },
      ]
    }]
*/

export interface DepartmentItem {
  depcode: string;
  depname: string;
  children: DepartmentList | null;
}

export type DepartmentList = DepartmentItem[];

export interface GetHospitalScheduleRuleParams {
  page: number;
  limit: number;
  hoscode: string;
  depcode: string;
}

/*
  排班规则数据：
    {
      "total": 342,
      "bookingScheduleList": [
        {
          "workDate": "2024-08-28",
          "workDateMd": null,
          "dayOfWeek": "周三",
          "docCount": 3,
          "reservedNumber": 397,
          "availableNumber": 269,
          "status": null
        },
      ]
    }
*/

export interface BookingScheduleItem {
  workDate: string;
  // "workDateMd": null,
  dayOfWeek: string;
  docCount: number;
  reservedNumber: number;
  availableNumber: number;
  // "status": null
}

export type BookingScheduleList = BookingScheduleItem[];
export interface GetHospitalScheduleRuleResponse {
  total: number;
  bookingScheduleList: BookingScheduleList;
  baseMap: {
    hosname: string;
  };
}

export interface GetHospitalDoctorListParams {
  hoscode: string;
  depcode: string;
  workDate: string;
}

/*
  医生数据：
    {
      "id": "65e0207fb998b10f14b2e516",
      "createTime": "2024-02-29 14:13:19",
      "updateTime": "2024-02-29 14:13:19",
      "isDeleted": 0,
      "param": {
        "dayOfWeek": "周日",
        "depname": "多发性硬化专科门诊",
        "hosname": "北京人民医院"
      },
      "hoscode": "1000_0",
      "depcode": "200040878",
      "title": "医师",
      "docname": "",
      "skill": "内分泌科常见病。",
      "workDate": "2024-08-25",
      "workTime": 0,
      "reservedNumber": 330,
      "availableNumber": 220,
      "amount": 100,
      "status": 1,
      "hosScheduleId": "1763085016935575554"
    }
*/

export interface DoctorItem {
  id: string;
  // createTime: "2024-02-29 14:13:19";
  // updateTime: "2024-02-29 14:13:19";
  // isDeleted: 0;
  // param: {
  //   dayOfWeek: "周日";
  //   depname: "多发性硬化专科门诊";
  //   hosname: "北京人民医院";
  // };
  // hoscode: "1000_0";
  // depcode: "200040878";
  title: string;
  docname: string;
  skill: string;
  workDate: string;
  // workTime: 0;
  reservedNumber: number;
  availableNumber: number;
  amount: number;
  // status: 1;
  // hosScheduleId: "1763085016935575554";
}

export type DoctorList = DoctorItem[];
